<script setup>
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { apiGetClassify } from '../../api/apis'
// getClassify
const classifyList = ref([])
const getClassify = async () => {
  let res = await apiGetClassify({ pageSize: 15 })
  classifyList.value = res.data
}
getClassify()

// share app
onShareAppMessage(e => {
  return {
    title: '咸虾米壁纸',
    path: '/pages/index/index'
  }
})
onShareTimeline(e => {
  return {
    title: '咸虾米壁纸'
  }
})
</script>
<template>
  <view class="classLayout pageBg">
    <custom-nav-bar title="分类"></custom-nav-bar>
    <view class="classify">
      <theme-item v-for="item in classifyList" :key="item._id" :item="item"></theme-item>
    </view>
  </view>
</template>
<style lang="scss" scoped>
.classLayout {
  .classify {
    padding: 30rpx;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15rpx;
  }
}
</style>